revealer: Allocate extra size to child
authorBenjamin Otte <otte@redhat.com>
Wed, 19 Feb 2014 20:15:25 +0000 (21:15 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 20 Feb 2014 01:10:07 +0000 (02:10 +0100)
Do not constrain the child widget to its preferred size when the
revealer is larger.

https://bugzilla.gnome.org/show_bug.cgi?id=724742

gtk/gtkrevealer.c

index 32b6668c467f12d8122b66df4e2e7dd16dc271fd..511caa8966a988311f7b757ec28fd321a0d38560 100644 (file)
@@ -303,8 +303,8 @@ gtk_revealer_get_child_allocation (GtkRevealer   *revealer,
 
   child_allocation->x = 0;
   child_allocation->y = 0;
-  child_allocation->width = allocation->width;
-  child_allocation->height = allocation->height;
+  child_allocation->width = 0;
+  child_allocation->height = 0;
 
   child = gtk_bin_get_child (GTK_BIN (revealer));
   if (child != NULL && gtk_widget_get_visible (child))
@@ -318,6 +318,9 @@ gtk_revealer_get_child_allocation (GtkRevealer   *revealer,
         gtk_widget_get_preferred_height_for_width (child, child_allocation->width, NULL,
                                                    &child_allocation->height);
     }
+
+  child_allocation->width = MAX (child_allocation->width, allocation->width);
+  child_allocation->height = MAX (child_allocation->height, allocation->height);
 }
 
 static void